package com.five.wisdomClass.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.five.wisdomClass.entity.PublicCourse;
import com.five.wisdomClass.entity.TakeCourse;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface PublicCourseMapper extends BaseMapper<PublicCourse> {

    // 通过开始时间查询
    @Select("SELECT * FROM smartcampus.take_course WHERE start_time  LIKE CONCAT('%' ,#{startTime}, '%') AND course_number = #{courseNumber}")
    IPage<PublicCourse> selectByStartTime(IPage<?> page, String startTime, String courseNumber);

    // 通过结束时间查询
    @Select("SELECT * FROM smartcampus.take_course WHERE end_time  LIKE CONCAT('%' ,#{endTime}, '%') AND course_number = #{courseNumber}")
    IPage<PublicCourse> selectByEndTime(IPage<?> page, String endTime,String courseNumber);
}
